﻿using XW.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace XW.Core
{
    /// <summary>
    /// 公共定值
    /// </summary>
    public static class CommonConst
    {
        /// <summary>
        /// The dedault password
        /// </summary>
        public const string DEDAULT_PWD = "666666"; // 默认密码


        /// <summary>
        /// 中文语言code
        /// </summary>
        public const string LAN_ZH = "zh"; // 中文语言code

        /// <summary>
        /// 英语语言code
        /// </summary>
        public const string LAN_EN = "en"; // 英语语言code
        /// <summary>
        /// 英语语言code
        /// </summary>
        public const string LAN_KM = "km"; // 英语语言code
        public const string DEFAULT_GUID = "00000000-0000-0000-0000-000000000000"; // guid 空值

        /// <summary>
        /// 默认组织编号
        /// </summary>
        public const string DEFAULT_ORGCODE = "003"; 

        /// <summary>
        /// 上传服务器是否是OSS
        /// 如果 1 则为OSS  0 为Nas
        /// </summary>
        public static bool FileUploadServerIsOSS
        {
            get {
                return ConfigHelper.GetApp("FileServer:uploadServer") == "1";
            }
        
        }
        /// <summary>
        /// 图片文件服务的地址
        /// </summary>
        public static string ImageFileHost
        {
            get {
                return ConfigHelper.GetApp("FileServer:fileHost");
            }
        }
        /// <summary>
        /// Oss 目录名
        /// </summary>
        public static string OSSBucketName
        {
            get
            {
                return ConfigHelper.GetApp("FileServer:bucketName");
            }
        }
        /// <summary>
        /// OSS CDN url鉴权key
        /// </summary>
        public static string OssCdnKey
        {
            get
            {
                return ConfigHelper.GetApp("FileServer:ossCdnKey");
            }
        }

        public static string OssTokenUrl(string url) { 
            return CommonConst.ImageFileHost + ImageHelper.OssTokenUrl(url, CommonConst.OssCdnKey);
        }



        /// <summary>
        /// 总装班组类别编码
        /// </summary>
        public const string ZZBZLB_VALUE = "021"; // 总装班组类别编码

        /// <summary>
        /// 包装班组类别编码
        /// </summary>
        public const string BZBZLB_VALUE = "022"; // 包装班组类别编码 

        /// <summary>
        /// 成品检验工序编码
        /// </summary>
        public const string OPERATIONCODE_4_CPJY = "ZHCPYY999"; //   

        /// <summary>
        /// 机器TMU转换秒
        /// </summary>
        public const decimal MACHINETMU_2_SENCOND = (decimal)27.8;
        /// <summary>
        /// 机器浮余
        /// </summary>
        public const decimal MACHINE_RATE = (decimal)0.15;

        /// <summary>
        /// 人工TMU转换秒
        /// </summary>
        public const decimal MANUALTMU_2_SENCOND = (decimal)33.34;
        /// <summary>
        /// 人工浮余
        /// </summary>
        public const decimal MANUALTMU_RATE = (decimal)0.15;
    }
}
